package com.renshine.swing.component.dialog;

import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JDialog;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.renshine.base.util.FileUtil;
import com.renshine.base.util.StyleUtil;
import com.renshine.swing.component.panel.LoginPanel;
import com.renshine.swing.component.panel.SubmitPane;


@Component
@SuppressWarnings("serial")
public class LoginJDialog extends JDialog {

	private LoginPanel loginPanel;
	private SubmitPane submitPane;
	
	/**
	 * Create the dialog.
	 */
	public LoginJDialog() {
		setTitle("认仕医生");
		ImageIcon logoIcon = new ImageIcon(FileUtil.getFilePath("images/logo/16x16.png")); 
		setIconImage(logoIcon.getImage());
		setBounds(100, 100, 450, 280);
		StyleUtil.setWindowStyle(this);
		getContentPane().setLayout(new BorderLayout());
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	}

	public LoginPanel getLoginPanel() {
		return loginPanel;
	}

	@Autowired
	public void setLoginPanel(LoginPanel loginPanel) {
		getContentPane().add(loginPanel, BorderLayout.CENTER);
		this.loginPanel = loginPanel;
	}

	public SubmitPane getSubmitPane() {
		return submitPane;
	}

	@Autowired
	public void setSubmitPane(SubmitPane submitPane) {
		getContentPane().add(submitPane, BorderLayout.SOUTH);
		this.submitPane = submitPane;
	}
}
